home *** CD-ROM | disk | FTP | other *** search
- Defining and Using Macros
-
- ALPHA supports keyboard macros which record a sequence
-
- of keystrokes to be played back later w/ the function
-
- 'executeKeyboardMacro' (this function is also in the
-
- 'Utilities' menu) or written into a buffer by selecting
-
- 'Dump Function' from the 'Utilities' menu. The dump
-
- function prompts you for a macro name, which must
-
- consist only of letters of the alphabet, digits, and
-
- '_'.
-
-
- These macro declarations can then be edited, loaded, and
-
- bound to keystrokes. Loading a macro or a binding is
-
- accomplished by hiliting the text and selecting the
-
- "Load Selection" item of the 'Customize' window. If no
-
- text is hilited, the entire window is loaded by the same
-
- command. Macros can be bound to keys in exactly the same
-
- manner as functions (see above).
-
-
- Macros lines can be as simple as the name of a function
-
- or previously defined function. Macros can set
-
- variables. The functions 'saveVars' and 'restoreVars'
-
- have been provided to let macros leave the environment
-
- in the same state that they found it. The keyword "type"
-
- has been provided to
-
- enter text. One good way to learn to write macros is to
-
- record a macro and dump it to a file. Play w/ it, change
-
- things around, add functions, and reload it. If you want
-
- to keep it, just put it in the 'AlphaBits' file. Several
-
- example macros have been provided in the 'AlphaBits'
-
- file.
-
-
- Several commands which prompt for input actually compile
-
- the result of the prompt into the macro, as opposed to
-
- again prompting every time the macro is executed. These
-
- commands include the search and replace commands, 'ACMD'
-
- calls, and setting named marks and clipboards. To see
-
- what is compiled in these cases, try creating such a
-
- macro and dumping it to a buffer.
-
-
- The following are commands that can only be executed
-
- from macros, see the distributed 'AlphaBits' file for
-
- examples of use and syntax.
-
-
- • acmd "name" - execute named acmd, which must be in the
-
- resource fork of Alpha
-
- • clipsearch "name" - search for contents of named
-
- clipboard
-
- • copyclip "name" - copy selected text to named
-
- clipboard
-
- • cutclip "name" - cut selected text to named clipboard
-
- • define - used to name macro
-
- • deleteclip "name" - delete named clipboard
-
- • deletemark "name" - delete named mark
-
- • deletemenu "name" - remove menu from menubar
-
- • fileSet - used to define file sets
-
- • goto "name" - goto named mark
-
- • insertmenu "name" - insert menu into menubar
-
- • mark "name" - create named mark
-
- • menu - used to instantiate the user menu
-
- • message "<the message>" - puts a message on status
-
- line.
-
- • loadfile "<complete pathname>" - loads file.
-
- • openfile "<complete pathname>" - opens file.
-
- • prompt "<prompt str>" "<clip for result>" - prompts.
-
- the user and puts the result in the named clipboard.
-
- • putascii <ascii code> - can be used for 8-bit
-
- characters. The use of flex currently prevents the use
-
- of 8-bit characters in any direct form in the
-
- AlphaBits file.
-
- • replace "name" - replace selection
-
- • replaceFindAgain "name" - replace and find again
-
- • restoreVars - restore all numeric vars to saved
-
- values, re-entrant
-
- • saveVars - save all numeric vars, re-entrant
-
- • search "name" - search for string, based on current
-
- flag values
-
- • set - used to set variable contents (mirrors command
-
- that works outside macros as well
-
- • type "name" - inserts string into current window.
-
- '\r' means carriage return, '\t' means tab.
-
- • yankclip "name" - yank from named clipboard
-
-
- In addition, all three forms of bindings and unbindings
-
- can be placed in macros, with the exact same format as
-
- when they are used outside of macros, parenthesis and
-
- all.
-
-
-
- Undo and Redo
-
-
- ALPHA supports unlimited undo and redo. This means that
-
- most changes can be undone, and then redone, at will.
-
- Bear in mind that once you create new modifications, all
-
- changes that you have undone but not redone are lost.
-
- Another point to bear in mind is that saving a buffer to
-
- disk currently flushes the undo buffer.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-